package com.pojoin.system.service;

import com.pojoin.common.domain.Tree;
import com.pojoin.common.utils.Query;
import com.pojoin.system.domain.GradeDO;
import com.pojoin.system.domain.OrderDO;
import com.pojoin.system.domain.UserDO;
import com.pojoin.system.vo.UserVO;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;
import java.util.Set;

@Service
public interface UserService {
	UserDO get(Long id);

	UserDO getByCode(String code);

	List<UserDO> list(Map<String, Object> map);

	List<UserDO> partners(Map<String, Object> map);

	int count(Map<String, Object> map);
	int countPartner(Map<String, Object> map);

	int save(UserDO user);

	int update(UserDO user);

	int remove(Long userId);

	int batchremove(Long[] userIds);

	boolean exit(Map<String, Object> params);

	Set<String> listRoles(Long userId);

	int resetPwd(UserVO userVO,UserDO userDO) throws Exception;
	int adminResetPwd(UserVO userVO) throws Exception;
	Tree<UserDO> getTree(UserDO user);

	/**
	 * 更新个人信息
	 * @param userDO
	 * @return
	 */
	int updatePersonal(UserDO userDO);

	/**
	 * 更新个人图片
	 * @param file 图片
	 * @param avatar_data 裁剪信息
	 * @param userId 用户ID
	 * @throws Exception
	 */
    Map<String, Object> updatePersonalImg(MultipartFile file, String avatar_data, Long userId) throws Exception;

	String getnameBycode(String code);

	List<GradeDO> findGradeList();

	List<OrderDO> getOrderList(Query query);

	int getOrderCount(Query query);

	String  updateBalance(Integer id);

	int updateUserLevel(UserDO userDO, UserDO user, UserDO session) throws Exception;

	int countMyTeam(Long userId);

	int selectTodayNum();

	int selectSumUser();

	int selectMemUserByLevel(String level);

	int selectMemUserByGrade(String grade);

	Double selectSumMoney();
}
